pp108 : UpdateXMLObject (Deprecated)

UpdateXMLObject (Deprecated)


This Web service operation is used to create, delete, and update an XML Object.

SOAP Request

To create an XML Object:

<UpdateXMLObject xmlns="http://schemas.cordys.com/1.0/xmlstore">
    <tuple key="/cordys/wcp/emp">
        <new>
            <employee>
                <employeeid>1</employeeid>
                <employeename>Nancy</employeename>
            </employee>
        </new>
    </tuple>
</UpdateXMLObject>

Request Parameters

Parameter

Description

old

Optional. Contains the old tuple values.

new

Contains the new tuple values

SOAP Response

<UpdateXMLObjectResponse xmlns="http://schemas.cordys.com/1.0/xmlstore">
    <tuple key="/cordys/wcp/emp" lastModified="1026188351570"
        level="organization" name="emp"/>
</UpdateXMLObjectResponse>

Response Parameters

Parameter

Description

<tuple>

The <tuple> tag has an optional attribute 'version', which can contain isv, organization, or user. This specifies the version of the XML Store content that is to be retrieved.

key

Relative path of the XML Object. If the relative path does not exist, the connector creates the specified path and specified XML Object

name

Name of the XML object

lastModified

LastModified value of the XML Object

level

Specifies the version (user/organization/isv) where the XML Object is created

isFolder

If the value is 'true', it creates the specified folders

original

Specifies the correct case of the key as stored in the file system

Note:

  • The XMLStore uses optimistic locking. To update an XML Object, the lastModified-attribute has to be specified. The XML Store Service uses this attribute to determine if the XML Object to be updated has been modified recently.
  • If optimistic locking is not required, an unconditional-attribute can be set on the <tuple>. If the XML Object is not read-only and exists in the XML Store, no locking is performed and the XML Object will be modified. Example - <tuple key='emp.xml' unconditional='true'.
  • Specify only one tuple in a single SOAP request. XML Store does not support multiple tuples.
  • By default, the XML Object is searched in the current organization. If not found, it is then searched in the ISV folder. If the user wants a particular version (user/isv/organization) of XML Object to be retrieved, then the version can be specified in the version attribute of <tuple>.

SOAP Request

To delete an XML Object

<UpdateXMLObject xmlns="http://schemas.cordys.com/1.0/xmlstore">
    <tuple key="/cordys/wcp/emp" lastModified="1006212444000" pruneHierarchy="true"/>
</UpdateXMLObject>

Request Parameters

Parameter

Description

tuple

Mandatory. Must contain the key, which maps to the xmlstore object that needs to be deleted.
pruneHierarchy is an optional attribute introduced in BOP 4.2. When true, the delete operation will also attempt to prune the xmlstore parent hierarchy for that specified key. In the above example, the delete operation will also delete /cordys/wcp if it has no children other than emp. The same applies to /cordys.
Note: Pruning is effective only when the parent object has no children.

old

Optional. Contains the old tuple values.

SOAP Response

<UpdateXMLObjectResponse xmlns='http://schemas.cordys.com/1.0/xmlstore'/

Note:

  • While deleting a folder, the SOAP message must contain <tuple recursive = 'true'>, to ensure that the contents of the folder are also deleted. If this attribute is not specified, then a SOAP Fault error would occur. If any key in the specified folder is blocked for delete then the whole operation will be aborted.
  • Set the content of the lastModified-attribute of the <tuple>. The lastModified-attribute of a XML Object can be obtained by retrieving the XML Object. The lastModified-attribute can be found in the response message of the XML Store.
  • Specify the version attribute as user/organization/isv to specify the version to be deleted.

SOAP Request

To update an XML Object

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <UpdateXMLObject xmlns="http://schemas.cordys.com/1.0/xmlstore">
            <tuple isFolder="false" key="cordys/audit/artifacts/ann"
                level="organization" name="test" original=""
                recursive="false" unconditional="true" version="">
                <old>
                    <employee>
                        <employeeid>1</employeeid>
                        <employeename>Nancy</employeename>
                    </employee>
                </old>
                <new>
                    <employee>
                        <employeeid>2</employeeid>
                        <employeename>Nancy2</employeename>
                    </employee>
                </new>
            </tuple>
        </UpdateXMLObject>
    </SOAP:Body>
</SOAP:Envelope>

Request Parameters

Parameter

Description

<tuple>

The <tuple> tag has an optional attribute 'version' which can contain isv or organization or user. This specifies the version of the XML Store content that is to be retrieved.

key

Relative path of the XML Object. If the relative path does not exist, the connector creates the specified path and specified XML Object

name

Name of the XML object

lastModified

LastModified value of the XML Object

level

Specifies the version (user/organization/isv) where the XML Object is created

isFolder

If the value is 'true', it creates the specified folders

original

Specifies the correct case of the key as stored in the file system

This <folder> has an attribute called 'recursive', which is used to specify whether to list the XML Objects recursively. When this is used, if any subfolders are encountered, then all the XML Objects in those folders are also retrieved. This attribute takes Boolean values ('true' and 'false'). The default value is 'false'.

Note:

  • The XMLStore uses optimistic locking. In order to update an XML Object, the lastModified-attribute has to be specified. The XML Store Service uses this attribute to determine if the XML Object that is to be updated has been modified recently.
  • If optimistic locking is not required, an unconditional-attribute can be set on the <tuple>. If the XML Object is not a read-only and exists in the XML Store, no locking is performed and the XML Object will be modified. Example - <tuple key='emp.xml' unconditional='true'.

SOAP Response

<UpdateXMLObjectResponse xmlns="http://schemas.cordys.com/1.0/xmlstore" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <tuple isFolder="false" key="cordys/audit/artifacts/ann"
        lastModified="1237875496426" level="organization" name="ann"
        original="/cordys/audit/artifacts/ann" recursive="false"
        unconditional="true" version=""
        xmlns="http://schemas.cordys.com/1.0/xmlstore" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"/>
</UpdateXMLObjectResponse>

Response Parameters

Parameter

Description

<tuple>

The <tuple> tag has an optional attribute 'version' which can contain isv or organization or user. This specifies the version of the XML Store content that is to be retrieved.

key

Relative path of the XML Object. If the relative path does not exist, the connector creates the specified path and specified XML Object

name

Name of the XML object

lastModified

LastModified value of the XML Object

level

Specifies the version (user/organization/isv) where the XML Object is created

isFolder

If the value is 'true', it creates the specified folders

original

Specifies the correct case of the key as stored in the file system

recursive

Specifies if the XML Objects must be listed recursively. When this is used, if any subfolders are encountered, then all the XML Objects in those folders are also retrieved. This attribute takes Boolean values ('true' and 'false'). The default value is 'false'.